import { View } from '@tarojs/components';
import { AtList, AtListItem } from 'taro-ui';
import './index.scss';

export default function ({ orderDetail }) {
  const { totalPrice, expressPrice, productPrice, orderStatus, refoundDesc, refoundType, orderType } =
    orderDetail;
  console.log('orderdetail', orderDetail);
  return (
    <View className="order-amount section-block">
      {orderStatus === 0 ? (
        <AtList>
          <AtListItem title="合计" extraText={'￥' + productPrice} />
          {orderType === 1 && <AtListItem title="运费" extraText={'￥' + expressPrice} />}
          <AtListItem className="red-color" title="待支付" extraText={'￥' + totalPrice} />
        </AtList>
      ) : orderStatus === 1 || orderStatus === 2 || orderStatus === 4 || orderStatus === 3 ? (
        <AtList>
          <AtListItem title="合计" extraText={'￥' + productPrice} />
          <AtListItem title="付款" extraText={'￥' + totalPrice} />
          <AtListItem className="red-color" title="合计付款" extraText={'￥' + totalPrice} />
        </AtList>
      ) : (
        <AtList>
          <AtListItem title="售后方式" extraText={refoundType} />
          <AtListItem
            title="退款金额"
            className="refound-amount"
            extraText={'￥' + totalPrice + `(含运费￥${expressPrice})`}
          />
          {/* <AtListItem title="退款说明" extraText={refoundDesc} /> */}
        </AtList>
      )}
    </View>
  );
}
